package com.itheima.exerciseTest.test60_69;

import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Properties;

public class Test61 {
    public static void main(String[] args) throws IOException {


        // 写数据
        // 创建Properties集合对象
        Properties prop1 = new Properties();
        prop1.setProperty("张三","23");
        prop1.setProperty("李四","24");
        prop1.setProperty("王五","25");
        prop1.setProperty("王五","26");
        FileWriter fw = new FileWriter("backBurner\\prop.properties");
        prop1.store(fw,"没干啥");
        fw.close();

        // 读数据
        Properties prop2 = new Properties();
        FileReader fr = new FileReader("backBurner\\prop.properties");
        prop2.load(fr);
        fr.close();
        System.out.println(prop2);

    }
}
